@extends('layouts.supervisor')

@section('content')
<div class="page-content">

    <div class="row">

        <div class="col-xs-12">

            <h3 class="header smaller lighter blue">评审学生论文列表</h3>

            <div class="table-responsive">

                <table id="sample-table-2" class="table table-striped table-bordered table-hover">
                    <thead>
                        <tr>
                            <th>学生姓名</th>
                            <th>查看论文</th>
                            <th>评审分数</th>
                            <th> 操作 </th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach($students as $approvedStudent)
                        <tr>
                            <td>
                                <a href="/supervisor/thesis/checkpaper/{{$approvedStudent->id}}">{{$approvedStudent->user->name}}</a>
                            </td>
                            <td>
                                @if ($approvedStudent->paper->count() > 0) 
                                    <a href="/download/papers/{{$approvedStudent->paper->last()->paper}}">{{$approvedStudent->paper->last()->paper}}</a> 
                                @else
                                    该学生还未提交论文，TA电话：{{$approvedStudent->user->phone}}
                                @endif
                            </td>
                            <td>
                                @if ($approvedStudent->review_comment != null) 
                                    {{$approvedStudent->review_comment->grade}}
                                @else
                                    还未给评语
                                @endif
                            </td>
                            <td>
                                <button class="btn btn-pink btn-sm" onclick="window.location.href='/supervisor/thesis/review_comment/{{$approvedStudent->id}}'">
                                                <i class="icon-edit"></i>
                                                评审评语
                                </button>
                                <button class="btn btn-pink btn-sm" onclick="window.location.href='/download/cjd/{{$approvedStudent->id}}'">
                                                <i class="icon-edit"></i>
                                                下载成绩单
                                </button>
                                <button class="btn btn-pink btn-sm" onclick="window.location.href='/download/dbzgscb/{{$approvedStudent->id}}'">
                                                <i class="icon-edit"></i>
                                                下载答辩资格审查表
                                </button>
                                <button class="btn btn-pink btn-sm" onclick="window.location.href='/download/pyrpsb/{{$approvedStudent->id}}'">
                                                <i class="icon-edit"></i>
                                                下载评阅人评审表
                                </button>

                            </td>
                        </tr>
                        @endforeach
                    </tbody>
                </table>
    
            </div>
            
        </div>

    </div>
</div>
@endsection
